import json
import pickle

data = [{'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5}]

data2 = json.dumps({'a': 'Runoob', 'b': 7}, sort_keys=True, indent=4, separators=(',', ': '))
print(data2)
# 序列化
str = pickle.dumps(data)
print(str)
pickle.dump(data, open('pickle.txt', 'wb'))
# 反序列化
print(pickle.loads(str))
print(pickle.load(open('pickle.txt', 'rb')))
